ALMaSS  1.0
The Animal, Landscape and Man Simulation System
AlleleFreq Class Reference

Class to handle statistics and constructs based on allele frequencies. More...

#include <GeneticMaterial.h>

Public Member Functions

 AlleleFreq ()
 
int SupplyAN (int loc, int al)
 

Protected Attributes

int AlleleNumber [32][16]
 
float AlleleFrequency [32][16]
 
float HE [32]
 
float HO [32]
 
int NoAlleles [32]
 

Detailed Description

Class to handle statistics and constructs based on allele frequencies.

Constructor & Destructor Documentation

◆ AlleleFreq()

AlleleFreq::AlleleFreq ( )
55  {
56  FILE * FreqFile = fopen("GeneticFrequencies.txt", "r" );
57  int data;
58  if ( !FreqFile ) {
59  g_msg->Warn( "GeneticFrequencies File missing", "" );
60  exit( 0 );
61  }
62  for ( int i = 0; i < 16; i++ ) {
63  for ( int j = 0; j < 4; j++ ) {
64  fscanf( FreqFile, "%d", & data );
65  AlleleNumber[ i ] [ j ] = data;
66  }
67  }
68  for ( int i = 16; i < 32; i++ ) {
69  for ( int j = 0; j < 16; j++ ) {
70  fscanf( FreqFile, "%d", & data );
71  AlleleNumber[ i ] [ j ] = data;
72  }
73  }
74  fclose( FreqFile );
75 }
int AlleleNumber[32][16]
Definition: GeneticMaterial.h:64
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41

References AlleleNumber, g_msg, and MapErrorMsg::Warn().

Member Function Documentation

◆ SupplyAN()

int AlleleFreq::SupplyAN ( int  loc,
int  al 
)
inline
71 { return AlleleNumber[loc][al];}

References AlleleNumber.

Referenced by GeneticMaterial::Initiation().

Member Data Documentation

◆ AlleleFrequency

float AlleleFreq::AlleleFrequency[32][16]
protected

◆ AlleleNumber

int AlleleFreq::AlleleNumber[32][16]
protected

Referenced by AlleleFreq(), and SupplyAN().

◆ HE

float AlleleFreq::HE[32]
protected

◆ HO

float AlleleFreq::HO[32]
protected

◆ NoAlleles

int AlleleFreq::NoAlleles[32]
protected

The documentation for this class was generated from the following files: